package bufferings.lab.slim3.check;

import static org.junit.Assert.*;
import static org.junit.Assume.*;

import java.util.logging.Logger;

import org.junit.Test;
import org.slim3.util.AppEngineUtil;

public class AssumptionCheck {

  private static final Logger logger =
    Logger.getLogger(AssumptionCheck.class.getName());

  @Test
  public void No001_AssumeOKAndAssertOK() {
    assumeTrue(true);
    assertTrue(true);
  }

  @Test
  public void No002_AssumeOKAndAssertNG() {
    assumeTrue(true);
    assertTrue(false);
  }

  @Test
  public void No003_AssumeNGAndAssertOK() {
    assumeTrue(false);
    assertTrue(true);
  }

  @Test
  public void No004_AssumeNGAndAssertNG() {
    assumeTrue(false);
    assertTrue(false);
  }

  @Test
  public void No101_RunOnlyOnEclipse() {
    assumeTrue(!AppEngineUtil.isServer());
    logger.info("The test was run.");
  }

  @Test
  public void No102_RunOnlyOnDevServer() {
    assumeTrue(AppEngineUtil.isDevelopment());
    logger.info("The test was run.");
  }

  @Test
  public void No103_RunOnlyOnProdServer() {
    assumeTrue(AppEngineUtil.isProduction());
    logger.info("The test was run.");
  }

  @Test
  public void No104_RunOnlyOnTheServer() {
    assumeTrue(AppEngineUtil.isServer());
    logger.info("The test was run.");
  }
}
